﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Heart : MonoBehaviour {

	private SpriteRenderer sr;

	public Sprite BrokerSprite;

	public GameObject Explosion;

	public AudioClip dieAudio;


	// Use this for initialization
	void Start () {
		sr = GetComponent<SpriteRenderer>();
	}
	
	// Update is called once per frame
	void Update () {
		
	}

	private void Die() {
		Instantiate(Explosion, transform.position, transform.rotation);
		sr.sprite = BrokerSprite;
		PlayerManager.Instance.isDefeat = true;
		AudioSource.PlayClipAtPoint(dieAudio, transform.position);
	}
}
